// 配置文件相关的类型定义

// 车辆分类配置类型
export interface CategoryItem {
  name: string;
  value: string;
}

export interface CategoryConfig {
  carType: CategoryItem[];
  motorcycle: CategoryItem[];
  commercial: CategoryItem[];
  special: CategoryItem[];
  other: CategoryItem[];
}

// 燃油类型配置类型
export interface OilTypeItem {
  name: string;
  value: string;
}

export interface OilTypeConfig {
  gasoline: OilTypeItem[];
  ethanolGasoline: OilTypeItem[];
  diesel: OilTypeItem[];
  other: OilTypeItem[];
}

// 车辆创建请求类型
export interface CreateCarRequest {
  name: string;
  category: string;
  brand: string;
  carModel: string;
  productionTime: number | string;
  purchaseTime: number | string;
  vehicleType: 'fuel' | 'electric' | 'motor';
  licensePlate?: string;
  notes?: string;
  currentMileage?: number;
  fuelCapacity?: number;
  fuelType?: string;
  purchasePrice?: number;
  currency?: 'CNY' | 'USD' | 'EUR';
  batteryCapacity?: number;
  mileage?: number;
}

// 车辆响应类型
export interface CarResponse {
  _id: string;
  userId: string;
  name: string;
  category: string;
  brand: string;
  carModel: string;
  productionTime: number;
  purchaseTime: number;
  licensePlate?: string;
  notes?: string;
  vehicleType: string;
  currentMileage?: number;
  fuelCapacity?: number;
  fuelType?: string;
  purchasePrice?: number;
  currency: string;
  batteryCapacity?: number;
  mileage?: number;
  createdAt: Date;
  updatedAt: Date;
  age?: number; // 虚拟字段：车辆年龄
}

// 配置接口响应类型
export interface ConfigResponse<T> {
  success: boolean;
  message: string;
  data: T;
}
